<?php
namespace Home\Controller;

use Think\Controller;

class MsmController extends Controller
{
    public function index()
    {

        $this->display();
		
    }
	
    public function   getcode(){
		 $mobile = I("post.mobile");
        empty($mobile) && ajaxmsg(0,"请填写手机号");
        if(isMobile($mobile)){
            $vo = M("member")->where("mobile=".$mobile)->find();
            is_array($vo)&&ajaxmsg(0,"该手机号已注册");
            $vo = M("code")->where(array("mobile"=>$mobile))->order("id desc")->find();
            if($vo){
                $t = time()-$vo['add_time'];
                if($t<60) ajaxmsg(0,"发送次数频繁,请稍后再试");
            }
            
            sendCode($mobile,0,1);  //类型为2时为找回密码
            if($res===true) ajaxmsg(1,"发送成功"); //,验证码为.$res
            elseif($res) ajaxmsg(0,$res);
            else ajaxmsg(0,$res);
        }else ajaxmsg(0,"手机号码格式有误");
	} 

     
	 
	 
	 
	
}